package com.ruslan.magaz.repository;


import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.ruslan.magaz.domain.Category;
import com.ruslan.magaz.domain.Product;
import com.ruslan.magaz.domain.Rating;

public interface ItemDao {
	Product getProductById(int id);
	void addCategory(Category category);
	void removeCategory(int categoryId);
	Category getCategoryByName(String name);
	List<Category> getAllCategories();
	List<Category> getAllCategories(int pageNum, int pageSize);
	void editCategory(Category category);
	Category getCategoryById(int categoryId);
	int categoriesPageCount(int pageSize);
	Integer getFirstCategoryId();
	List<String> getCategoryNames();
	List<Product> getAllProductsForCategory(int categoryId, int pageNum, int pageSize);
	int productsForCategoryPageCount(int categoryId, int pageSize);
	List<Rating> getAllReviewsForProduct(int productId, int pageNum, int pageSize);
	int reviewsForProductPageCount(int productId, int pageSize);
	double getAvgRating(int productId);
	public int countRaters(int productId);
	Rating getRatingForUserNItem(int userId,int itemId);
	void addRating(Rating rating);
	void editRating(Rating rating);
	int getCountForProductId(int productId);
	void moveProductsFromCategory(int fromId, int toId);
	int countItemsInCategory(int categoryId);
	void editProduct (Product product);
	void deepEditProduct(Product product);
	void addProduct(Product product);
}
